﻿using log4net;
namespace WPFExcelReport.Helpers
{
    public static class UMHelper
    {
         
        /// <summary>
        /// 记录正常的消息
        /// </summary>
        /// <param name="msg">消息内容</param>
        public static double GPKM(string ctyp,double K,string company="")
        {
            switch (ctyp)
            {
                case "NM":
                    K = 1000 / K;
                    break;
                case "TEX":
                    K = K;
                    break;
                case "NE":
                    K = Helper.RoundX(((0.4536 * 1000 * 1000) / (840 * 0.9144)) / K, 1000);
                    break;
                case "D":
                case "DN":
                case "DEN":                   
                    if(company=="SJH")
                    {
                        K = Helper.RoundX(K * 1.11 / 10, 1000); 
                    }
                    else
                    {
                        K = Helper.RoundX(K / 9, 1000);
                    }
                    break;
            }
            return K;
        }       
    }
}
